Define metamodel

Overview

A metamodel defines the structure and relationships of an entity. By defining a metamodel, you can formalize what you should design and constraints that you should consider when designing.

In the following, we will focus on a use case model consisting of actors and use cases. This section describes the basic steps for creating a new profile and defining a metamodel.

Image of defining metamodel

Metamodel definition

About the overall structure of the metamodel

Since Next Design can handle various models related to the product in one project, the number of models in the project is large. Therefore, it is useful to have a hierarchical structure that allows you to roughly divide the model types directly under the project.

In the following, we will define the metamodel so that the project has the following hierarchical structure. In this project example, [Requirement model] and [Design model] are provided directly under the project, and the types of models are roughly classified.

Project model structure example

It also increases the number of metamodel components defined in the profile. Therefore, it is easier to get a bird's-eye view of the entire metamodel by providing packages for each model type and classifying the components of the metamodel.

In the following, we will define the metamodel with the Use Case Model package as follows: In this profile example, the [Use Case Model] package is provided immediately below the root of the profile to classify the metamodel components.

Add Package to Profile

Advance preparation

Understand the screen structure

When defining a metamodel, the profile navigator is displayed on the left, the class diagram is displayed in the center, and the inspector is displayed on the right.

Metamodel editing screen configuration

To open the class diagram in the center, double-click the class diagram you want to open in the Profile Navigator. To close the class diagram, click the [x] icon that appears in the upper right corner of the class diagram.

Note

  • Unlike the model editor, the class diagram display does not change even if the selected node is changed by clicking the tree node in the profile navigator.
  • To view another class diagram, double-click the class diagram you want to view to open it.

Below, let's define the metamodel of the use case model by the following procedure.

  1. Add use case model to profile
  2. Define the structure of the use case model

1. Add use case model to profile

To add a use case model metamodel to your profile, follow these steps:

  1. Create a project for the new profile
  2. Configure profile and add [Use Case Model] entity
  3. Prepare class diagram to define [use case model] metamodel

1.1 Create a new project

Create project for new profile

To create a project for a new profile, follow the steps below to create a new project.

Create new profile

Operating procedure

  1. Launch Next Design and from the Start Menu, click the Start> Create New Project link.
  2. In the [Create New Project] dialog, enter the [Project Name], do not specify the [Profile], and click the [Create] button to create a new project.

Switch to screen configuration for metamodel definition

To switch to the screen configuration for metamodel definition explained in the preparation, follow the procedure below.

Metamodel definition screen configuration

Operating procedure

  1. Select Profile Navigator from the selector at the top of the navigator to switch navigators.
  2. Click View> Pane> Inspector on the ribbon to display the Inspector on the right side of the screen.

1.2 Configure profile

Add entities directly under the project

In order to roughly divide the model types directly under the project, add the [Request model] entity in the following procedure.

Add entity under project

Operating procedure

  1. Right-click [Project Definition Sample] displayed at the top of the profile navigator, and click From the context menu, click Add> Metamodel> Entity.
  2. In the [New Entity] dialog, enter the items as shown in the table below and click the [OK] button.
Item Value
[Display Name] Enter "Requirement Model" as the name
[Class Name] (The same name as the display name is automatically entered)
[Icon] Select an icon from the options

Changed definition so that it can be placed directly under the project

The entities that can be added directly under the project in the model navigator during modeling are limited to specific entities. To be able to add the [Request Model] added in the previous step directly under the project, change the definition in the following step.

Placement definition directly under the project

Operating procedure

  1. Select Requirement Model in the Profile Navigator to view the details in the Inspector.
  2. In the Inspector, check Allow deployment directly under the project.

Create a package and add [Use Case Model] entity

To put a package in your profile and add a Use Case Model entity, do the following:

Add Use Case Model

Operating procedure

  1. Right-click [Project Definition Sample] displayed at the top of the profile navigator, and click From the context menu, click Add> Package.
  2. Right-click the added package and click Rename from the context menu to rename it to Use Case Model.
  3. Next, click Add> Metamodel> Entity from the package context menu.
  4. In the [New Entity] dialog, enter [Use Case Model] in [Display Name], select [Icon], and click the [OK] button.

1.3 Prepare a class diagram that defines the metamodel

Added class diagram to [Use Case Model]

To define the Use Case Model metamodel in UML class diagram format, add a class diagram as follows:

Add Class Diagram

Operating procedure

  1. Right-click on the Use Case Model package on the Profile Navigator and click Click Add Class Diagram from the context menu.
  2. Enter Use Case Model Structural Diagram as the name of the class diagram added on the Profile Navigator.

Configure parent-child relationship of [use case model]

In order to create a model hierarchically at the time of modeling, it is necessary to connect the entities that correspond to the parent-child relationship in the ownership relationship.

To be able to add a Use Case Model under Requirement Model when modeling, follow these steps to establish an ownership relationship.

Configure parent-child relationship

Operating procedure

  1. Double-click Use Case Model Structure Diagram to open the class diagram.
  2. Drag and drop the Request Model and Use Case Model from the Profile Navigator to add them to the class diagram.
  3. To make an association, move the pointer to the parent [Requirement Model], drag the [▲] icon displayed in the four directions, and drop it on the [Use Case Model] to be associated.
  4. When you drop it, the related type of choice pops up. Click [Embedded] from among them to select it.
  5. This establishes an ownership relationship from the Requirement Model to the Use Case Model and defines a parent-child relationship between the Requirement Model and the Use Case Model.

2. Define the structure of the use case model

To define the structure of the Use Case Model, add and associate the Actor and Use case entities to your class diagram. The procedure is as follows.

  1. Add [Actor] and [Use case] as entities.
  2. Add a field to the entity.
  3. Associate the entities to define the Use Case Model structure.

2.1 Add entity

To add an entity to your class diagram, do the following:

Add Entity

Operating procedure

  1. Add [Entity] from the Class Toolbox by dragging and dropping, and enter the name.
  2. Here, add [Actor] and [Use case] as entities.

Attention

  • If you select an entity and press the Del key, it will only be hidden on the class diagram and will not be deleted from the metamodel, as on the context menu [Delete From Diagram]. Also remains.
  • If you want to delete an entity that you added by mistake, execute [Delete From Model] from the context menu of the entity.

To change the icon of the added entity, do the following:

Change Entity Icon

Operating procedure

  1. In the class diagram, select the entity whose icon you want to change.
  2. Select the icon in the Inspector.

2.2 Add fields to entities

To add a field to hold data for your entity:

Add Field

Operating procedure

  1. Move the pointer over the entity in the class diagram.
  2. Click the [+] icon displayed at the right end of [Filelds]. Here, add the Precondition field (string type) to the Use case entity as follows:
  3. In the [Add New Fields] dialog, enter the items as shown in the table below and click the [OK] button.
Item Value
[Display Name] Enter "Precondition" as name
[Field Name] (The same name as the display name is automatically entered)
[Data Type] Select [String] from the options

2.3 Associate to define structure

To be able to add another entity as a child element of an entity, you create an ownership relationship that represents a parent-child relationship between the entities.

Also, to allow association with entities other than parent-child relationships, such as [Actor] and [Use case], connect a reference relationship between the entities.

Here, the following two types of relationships are defined as the structure definition of [Use Case Model].

Relationship Description
Ownership relationship from [UseCaseModel] to [Actor] and [UseCase]. It becomes possible to add [Actor] and [Use case] as a child of [Use Case Model] from [Use Case Model] to [Actor] and [Use case].
Reference related to [Actor] to [Use case] You can now associate [Actor] with [Use case].

Associate Entity

Operating procedure

  1. Move the pointer over the source entity.
  2. Drag the [▲] icon that appears in four directions and drop it on the related entity.
  3. A related type of choice will pop up, click to select it.

Attention

  • Similar to deleting an entity, if you select a related line on the class diagram and press the Del key, it will only be hidden on the class diagram, not deleted from the metamodel, but on the profile navigator. Also remains.
  • If you want to delete an association that you added by mistake, select [Delete From Model] from the context menu of the association line.